<%
/*
Copyright 2010-2011 CumulusCloud
http://cumuluscloud.cc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="cumulusCloud.common.ManageApplication"%>
<%@page import="cumulusCloud.common.HtmlComponents"%>

<%@page import="cumulusCloud.common.InformationServer"%>
<%@page import="cumulusCloud.common.InformationCore"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<%=HtmlComponents.headBannerCSS(false)%>
<%=HtmlComponents.headApplicationIcon("ROOT", false)%>
<title>Cloud</title>
</head>
<body>
<%=HtmlComponents.bodyTopBanner("Application Launcher", false, false)%>
<p>Applications</p>
<table border="1">
<tr>
<%
int i=0;
for (String nextApplication: ManageApplication.listApplicationsDirsNames()) {
	if (i==4) {
		out.println("</tr><tr>");
		i = 0;
	}
	++i;
	
	String icon = ManageApplication.getApplicationIconURL(nextApplication);
	out.println("<td><img src=\"" + icon + "\" width=\"32\" height=\"32\"><a href=\"/" + nextApplication + "\">" + nextApplication + "</a></td>");
}
%>
</tr>
</table>
<br/>
<hr/>
<p style="font-size: small">Server<br/>
<% 

String url = InformationServer.getInternetNonSecureBaseURL();
if (url != null) {
	out.println("<a href='" + url + "'>" + url + "</a> for unencrypted connection<br/>");
}

url = InformationServer.getInternetSecureBaseURL();
if (url != null) {
	out.println("<a href='" + url + "'>" + url + "</a> for encrypted connection<br/>");
}

%>

Current <a href="http://cumuluscloud.cc">CumulusCloud</a> version: <%= InformationCore.getCoreVersion() %>

</p>

</body>
</html>